var A = function () {
    var A = function (select) {
        return new A.fn.init(select);
    }

    A.fn = A.prototype = {
        constructor : A,
        push : [].push,
        sort : [].sort,
        splice : [].splice,
        length: 0,
        init: function (select) {
            this[0] = document.querySelector(select);
            this.length = 1;
            return this;
        }
    }

    A.fn.extend = function(...rest) {
        var i = 1, j;
        var len = rest.length;
        var target = rest[0];
        if(i == len) {
            target = this;
            i--
        }
        for(; i < len; i++) {
            for(j in rest[i]) {
                target[j] = rest[i][j]
            }
        }

        return target
    }

    A.fn.init.prototype = A.fn;

    return A
}()

window.A = A;